#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include "cut.h"



using namespace std;
using namespace cv;



Cut::Cut(void){

  Mat img;
  vector<Mat> imgHSVs;
  int nRows, nCols, i, j;
  string imgPath  = "../pic/8.jpg";
  string imgCPath = "../pic/result.jpg";
  cout << "load parameter succeed." << endl;
  
  /* 读取图片 */
  img = imread(imgPath);
  nRows = img.rows;
	nCols = img.cols;
  cout << "read image ok." << "  heigh: " << nRows << "  width: " << nCols << endl;
  
  /* 剪裁 */
  Rect rect(300, 0, 1320, 1080);
  //imgC = Mat(img, rect);
  Mat imgC(img, rect);
  
  
  /* 保存剪裁图片 */
  imwrite(imgCPath, imgC);
  cout << "save cut picture ok." << endl;
}


Cut::~Cut(void){
  cout << "byby ~~~ I'm jianbao" << endl;
}





